google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',null,null,183,154], ['2日',null,null,166,192], ['3日',null,null,112,200], ['4日',null,193,132,193], ['5日',191,null,191,null], ['6日',null,null,null,null], ['7日',178,132,178,132], ['8日',null,null,161,96], ['9日',null,null,163,138], ['10日',null,null,127,173], ['11日',null,null,108,168], ['12日',140,null,140,171], ['13日',null,null,null,177], ['14日',167,null,167,167], ['15日',null,null,162,175], ['16日',null,null,171,147], ['17日',null,161,150,161], ['18日',null,null,106,null], ['19日',null,null,114,null], ['20日',null,null,133,null], ['21日',null,164,193,164], ['22日',null,null,154,null], ['23日',null,187,160,187], ['24日',null,null,133,149], ['25日',158,150,158,150], ['26日',null,null,null,null], ['27日',164,136,164,136], ['28日',null,169,152,169], ['29日',null,null,177,null], ['30日',null,null,141,null], ['31日',null,null,188,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:250},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=28 -1 ; var lastlogcat=4; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });